Hide Price if $0 v.2.0
By: (Islander2u) Eric Montgomery
risingisland@yahoo.com
Canary Islands, Spain
by Kiril Nedelchev <kikoleppard@hotmail.bg>
August, 1 , 2005 - MODIFIED for Attribute Suite v.1.2.3
- i left only the price hiding not the button "Buy now" hiding
-------------------------------------------------------------------------
Info:
This contribution is intended to hide the price and purchase button from the catalog if no price has been entered, instead of showing a price of $0.00.
This may be of use if you want some items to be informational items only, such as services or to use your shop as a catalog only.
This contribution contains both the files that can be dropped in on a clean copy of OSC2.2M2 as well as instructions for manually applying this contribution for those who have already tinkered with the original files.
-------------------------------------------------------------------------
Idias/Tips:
In the second portion of several of the steps below, at the end of the modification you will find a bit of code,somthing like:
IMAGE_BUTTON_IN_CART) : ''); ?>
or
IMAGE_BUTTON_IN_CART) . '</a>': ' '); ?></td>
or
IMAGE_BUTTON_IN_CART) : '') . '</a></p>';
etc.
You could add a "Call for price" or something of that nature to display where the button once was, by inserting a comment or tag simular to the following:
IMAGE_BUTTON_IN_CART) : 'Call for Price'); ?>
or
IMAGE_BUTTON_IN_CART) . '</a>': 'Call for Price'); ?></td>
or
IMAGE_BUTTON_IN_CART) : '') . '</a></p>Call for Price';
etc.
or get really fancy and add a reference to your lang files...
-----------------
Also, some people wanted to hide the price but not the buttons for spicific reasons, this can be achived by simply omitting the second edit in most of the steps.
I've done this :)
-------------------------------------------------------------------------
...and now onto the fun...
Files to be edited or replaced:
catalog/
product_info.php
product_new.php
product_reviews.php
product_reviews_info.php
product_reviews_write.php
catalog/includes/boxes/
whats_new.php
catalog/includes/modules/
new_products.php
product_listing.php
#########################################################################
Step 1.
-------
catalog/product_info.php
Around line 93 replace the following line:
<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
with:
<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->
<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->
<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>
<!-- End "Hide Price if $0" edit 1 of 2 -->
-------------------------------------------------------------------------
Step 2.
-------
catalog/product_new.php
around line 84 replace the following line:
$products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
with:
//$products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
// Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution)
$products_price = (($products_new['products_price'] > 0) ? $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) : '');
// End "Hide Price if $0" edit 1 of 2
-------------------------------------------------------------------------
Step 3.
-------
catalog/product_reviews.php
Around line 70 replace the following line:
<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
with:
<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->
<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->
<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>
<!-- End "Hide Price if $0" edit 1 of 2 -->
-------------------------------------------------------------------------
Step 4.
-------
catalog/product_reviews_info.php
Around line 79 replace the following line:
<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
with:
<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->
<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->
<td class="pageHeading" align="right" valign="top"><?php echo (($review['products_price'] > 0) ? $products_price : ''); ?></td>
<!-- End "Hide Price if $0" edit 1 of 2 -->
-------------------------------------------------------------------------
Step 5.
-------
catalog/product_reviews_write.php
Around line 130 replace the following line:
<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
with:
<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->
<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->
<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>
<!-- End "Hide Price if $0" edit 1 of 2 -->
-------------------------------------------------------------------------
Step 6.
-------
catalog/includes/boxes/whats_new.php
around line 31 replace the following line:
$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
with:
//$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
// Start "Hide Price if $0" edit 1 of 1 (uncomment above line if removing this contribution)
$whats_new_price = (($random_product['products_price'] > 0) ? $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) : '');
// End "Hide Price if $0" edit 1 of 1
-------------------------------------------------------------------------
Step 7.
-------
catalog/includes/modules/new_products.php
around line 33 replace the following line:
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));
with:
//'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));
// Start "Hide Price if $0" edit 1 of 1 (uncomment above line if removing this contribution)
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . (($new_products['products_price'] > 0) ? $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) : ''));
// End "Hide Price if $0" edit 1 of 1
-------------------------------------------------------------------------
Step 8.
-------
catalog/includes/modules/product_listing.php
around line 112 replace the following line:
$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
with:
//$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
// Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution)
$lc_text = ' ' . (($listing['products_price'] > 0) ? $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : '') . ' ';
// End "Hide Price if $0" edit 1 of 2
#########################################################################
If anyone besides my self finds this of any use, please let me know.
Questions/Comments always welcome, as well as donations (PayPal, risingisland@yahoo.com) ;)
-------------------------------------------------------------------------
...Drum roll please...
Special Thanks To:
John of robinson-dixon.de
Patricia M. Montgomery
Binny of nandidvd.com
J. Luis of za-gas.com
Jack of Arts of jack-of-arts.com
Cuauhtemoc Ramirez
Cliff Murphy
Rudy Apollon of veedubdesign.com
Loic Martenot of eldesem.com
Peter Smith of rv.com.au
Kurt Deutscher of playallegra.com
Daniel Marshall
Ryan of streetflossin.com
Yannick Monnier
For your thanks and input on this contribution.